﻿using CookComputing.XmlRpc;
using PerceptiveMCAPI.Types;
using PerceptiveMCAPI.Types.Internal;
//
namespace PerceptiveMCAPI
{
	[XmlRpcUrl( "http://api.mailchimp.com/1.3/" )]
	public interface IMC : IXmlRpcProxy
	{
		#region ==================================================================== "Campaign Related"

		[XmlRpcMethod( "campaignContent" )]
		x_campaignContent campaignContent( string apikey, string cid, bool for_archive );
		//
		[XmlRpcMethod( "campaignCreate" )]
		string campaignCreate( string apikey, string type, XmlRpcStruct options, XmlRpcStruct content, XmlRpcStruct segment_opts, XmlRpcStruct type_opts );
		//
		[XmlRpcMethod( "campaignDelete" )]
		bool campaignDelete( string apikey, string cid );
		//
		[XmlRpcMethod( "campaignEcommOrderAdd" )]
		bool campaignEcommOrderAdd( string apikey, XmlRpcStruct order );
		// 
		[XmlRpcMethod( "campaignPause" )]
		bool campaignPause( string apikey, string cid );
		//
		[XmlRpcMethod( "campaignReplicate" )]
		string campaignReplicate( string apikey, string cid );
		//
		[XmlRpcMethod( "campaignResume" )]
		bool campaignResume( string apikey, string cid );
		//
		[XmlRpcMethod( "campaignSchedule" )]
		bool campaignSchedule( string apikey, string cid, string schedule_time, string schedule_time_b );
		//
		[XmlRpcMethod( "campaignSegmentTest" )]
		int campaignSegmentTest( string apikey, string list_id, XmlRpcStruct options );
		//
		[XmlRpcMethod( "campaignSendNow" )]
		bool campaignSendNow( string apikey, string cid );
		//
		// send_type as string.empty doesn't send anything, and null gives exception -- 2 signatures needed
		[XmlRpcMethod( "campaignSendTest" )]
		bool campaignSendTest( string apikey, string cid, string[] test_emails );
		[XmlRpcMethod( "campaignSendTest" )]
		bool campaignSendTest( string apikey, string cid, string[] test_emails, string send_type );
		//
		[XmlRpcMethod( "campaignShareReport" )]   /* New with MC v1.2.3 */
		x_campaignShareReport campaignShareReport( string apikey, string cid, XmlRpcStruct opts );
		//
		[XmlRpcMethod( "campaignTemplateContent" )] /* New with MC v1.3.0 */
		XmlRpcStruct campaignTemplateContent( string apikey, string cid );
		//
		[XmlRpcMethod( "campaignUnschedule" )]
		bool campaignUnschedule( string apikey, string cid );
		//
		// ------------------------------------------------------------------------- campaignUpdate variations 
		[XmlRpcMethod( "campaignUpdate" )]
		bool campaignUpdate( string apikey, string cid, string name, string valString );
		//
		[XmlRpcMethod( "campaignUpdate" )]
		bool campaignUpdate( string apikey, string cid, string name, int valInt );
		//
		[XmlRpcMethod( "campaignUpdate" )]
		bool campaignUpdate( string apikey, string cid, string name, bool valBool );
		//
		[XmlRpcMethod( "campaignUpdate" )]
		bool campaignUpdate( string apikey, string cid, string name, campaignTracking tracking );
		//
		[XmlRpcMethod( "campaignUpdate" )]
		bool campaignUpdate( string apikey, string cid, string name, XmlRpcStruct valRpcStruct );
		// --------------------------------
		[XmlRpcMethod( "campaigns" )]
		x_campaigns campaigns( string apikey, XmlRpcStruct filters, int start, int limit );

		#endregion

		#region --------------------------------------------------------------- "Campaign Stats"

		[XmlRpcMethod( "campaignAbuseReports" )]
		x_campaignAbuseReports campaignAbuseReports( string apikey, string cid, string since, int start, int limit );

		[XmlRpcMethod( "campaignAdvice" )]  /* New with v1.2 */
		x_campaignAdvice[] campaignAdvice( string apikey, string cid );

		[XmlRpcMethod( "campaignAnalytics" )]  /* New with v1.2 */
		x_campaignAnalytics campaignAnalytics( string apikey, string cid );

		[XmlRpcMethod( "campaignBounceMessage" )]   /* New with v1.3 */
		x_campaignBounceMessage campaignBounceMessage( string apikey, string cid, string email );

		[XmlRpcMethod( "campaignBounceMessages" )]   /* New with v1.2 */
		x_campaignBounceMessages campaignBounceMessages( string apikey, string cid, int start, int limit, string since );

		[XmlRpcMethod( "campaignClickStats" )]
		object campaignClickStats( string apikey, string cid );

		[XmlRpcMethod( "campaignEcommOrders" )]   /* New with v1.2 */
		x_campaignEcommOrders campaignEcommOrders( string apikey, string cid, int start, int limit, string since );

		[XmlRpcMethod( "campaignEepUrlStats" )]  /* campaignEepUrlStats [MC v1.2.5] */
		object campaignEepUrlStats( string apikey, string cid );

		[XmlRpcMethod( "campaignEmailDomainPerformance" )] /* New with v1.2 */
		x_campaignEmailDomainPerformance[] campaignEmailDomainPerformance( string apikey, string cid );

		[XmlRpcMethod( "campaignGeoOpens" )]  /* campaignEepUrlStats [MC v1.2.5] */
		x_campaignGeoOpens[] campaignGeoOpens( string apikey, string cid );

		[XmlRpcMethod( "campaignGeoOpensForCountry" )]  /* campaignGeoOpensForCountry [MC v1.2.5] */
		x_campaignGeoOpensForCountry[] campaignGeoOpensForCountry( string apikey, string cid, string code );

		[XmlRpcMethod( "campaignHardBounces" )]	// DEPRECATED IN v1.3
		x_campaignHardBounces campaignHardBounces( string apikey, string cid, int start, int limit );

		[XmlRpcMethod( "campaignMembers" )]
		x_campaignMembers campaignMembers( string apikey, string cid, string status, int start, int limit );

		[XmlRpcMethod( "campaignSoftBounces" )]	// DEPRECATED IN v1.3
		x_campaignSoftBounces campaignSoftBounces( string apikey, string cid, int start, int limit );

		[XmlRpcMethod( "campaignStats" )]
		x_campaignStats campaignStats( string apikey, string cid );

		[XmlRpcMethod( "campaignUnsubscribes" )]
		x_campaignUnsubscribes campaignUnsubscribes( string apikey, string cid, int start, int limit );

		#endregion

		#region --------------------------------------------------------------- "Campaign Report Data"

		[XmlRpcMethod( "campaignClickDetailAIM" )]
		x_campaignClickDetailAIM campaignClickDetailAIM( string apikey, string cid, string url, int start, int limit );
		//
		[XmlRpcMethod( "campaignEmailStatsAIM" )]
		x_campaignEmailStatsAIM campaignEmailStatsAIM( string apikey, string cid, string[] email_address );

		[XmlRpcMethod( "campaignEmailStatsAIMAll" )]
		x_campaignEmailStatsAIMAll campaignEmailStatsAIMAll( string apikey, string cid, int start, int limit );

		[XmlRpcMethod( "campaignNotOpenedAIM" )]
		x_campaignNotOpenedAIM campaignNotOpenedAIM( string apikey, string cid, int start, int limit );

		[XmlRpcMethod( "campaignOpenedAIM" )]
		x_campaignOpenedAIM campaignOpenedAIM( string apikey, string cid, int start, int limit );

		#endregion

		#region --------------------------------------------------------------- "Ecommerce"

		// --------------------------------------------------- ecommOrderAdd [MC v1.2.5, rename MC v1.3.0]
		[XmlRpcMethod( "ecommOrderAdd" )]
		bool ecommOrderAdd( string apikey, XmlRpcStruct order );

		// --------------------------------------------------- ecommOrderAdd [MC v1.2.5, rename MC v1.3.0]
		[XmlRpcMethod( "ecommOrderDel" )]
		bool ecommOrderDel( string apikey, string store_id, string order_id );

		// --------------------------------------------------- ecommOrderAdd [MC v1.2.5, rename MC v1.3.0]
		[XmlRpcMethod( "ecommOrders" )]
		x_ecommOrders ecommOrders( string apikey, int start, int limit, string since );

		#endregion

		#region --------------------------------------------------------------- "Folder Related"
		//
		[XmlRpcMethod( "folderAdd" )]
		int folderAdd( string apikey, string name, string type );
		//
		[XmlRpcMethod( "folderDel" )]
		bool folderDel( string apikey, int fid, string type );
		//
		[XmlRpcMethod( "folderUpdate" )]
		bool folderUpdate( string apikey, int fid, string name, string type );
		//
		[XmlRpcMethod( "folders" )]
		x_folders[] folders( string apikey, string type );
		//
		#endregion

		#region ================================================= "Helper"

		// --------------------------------------------------- campaignsForEmail v1.3.0
		[XmlRpcMethod( "campaignsForEmail" )]
		string[] campaignsForEmail( string apikey, string email_address );

		// --------------------------------------------------- chimpChatter [MC v1.2.5]
		[XmlRpcMethod( "chimpChatter" )]
		x_chimpChatter[] chimpChatter( string apikey );

		// ------------------------------------------------------------ generateText
		// content 'mixed' -- 2 sigs
		[XmlRpcMethod( "generateText" )]
		string generateText( string apikey, string type, string content );
		[XmlRpcMethod( "generateText" )]
		string generateText( string apikey, string type, XmlRpcStruct content );

		// --------------------------------------------------- getAccountDetails new in MC v1.2.2
		[XmlRpcMethod( "getAccountDetails" )]
		x_getAccountDetails getAccountDetails( string apikey );
		//
		[XmlRpcMethod( "inlineCss" )]
		string inlineCss( string apikey, string html, bool strip_css );

		// --------------------------------------------------- listsForEmail [MC v1.2.5]
		[XmlRpcMethod( "listsForEmail" )]
		string[] listsForEmail( string apikey, string email_address );
		//
		[XmlRpcMethod( "ping" )]
		string ping( string apikey );

		#endregion

		#region ==================================================================== "Lists"

		[XmlRpcMethod( "listAbuseReports" )]   /* New with v1.2 */
		x_listAbuseReports listAbuseReports( string apikey, string id, int start, int limit, string since );
		//
		[XmlRpcMethod( "listActivity" )]   /* New with v1.3 */
		x_listActivity[] listActivity( string apikey, string id );
		//
		[XmlRpcMethod( "listBatchSubscribe" )]
		x_listBatchSubscribe listBatchSubscribe( string apikey, string id, XmlRpcStruct batch, bool double_optin, bool update_existing, bool replace_interests );
		//
		[XmlRpcMethod( "listBatchUnsubscribe" )]		// batch = emails
		x_listBatchUnsubscribe listBatchUnsubscribe( string apikey, string id, XmlRpcStruct batch, bool delete_member, bool send_goodbye, bool send_notify );
		//
		[XmlRpcMethod( "listClients" )]  /* New with v1.3 */
		x_listClients listClients( string apikey, string id );
		//
		[XmlRpcMethod( "listGrowthHistory" )]  /* New with v1.2 */
		x_listGrowthHistory[] listGrowthHistory( string apikey, string id );
		//
		[XmlRpcMethod( "listInterestGroupAdd" )]
		bool listInterestGroupAdd( string apikey, string id, string group_name );
		[XmlRpcMethod( "listInterestGroupAdd" )]
		bool listInterestGroupAdd( string apikey, string id, string group_name, int grouping_id );
		//
		[XmlRpcMethod( "listInterestGroupDel" )]
		bool listInterestGroupDel( string apikey, string id, string group_name );
		[XmlRpcMethod( "listInterestGroupDel" )]
		bool listInterestGroupDel( string apikey, string id, string group_name, int grouping_id );
		//
		[XmlRpcMethod( "listInterestGroupUpdate" )]     // v1.2.2
		bool listInterestGroupUpdate( string apikey, string id, string old_name, string new_name );
		[XmlRpcMethod( "listInterestGroupUpdate" )]     // v1.2.2
		bool listInterestGroupUpdate( string apikey, string id, string old_name, string new_name, int grouping_id );
		//
		[XmlRpcMethod( "listInterestGroupingAdd" )]              // -- v1.2.6
		int listInterestGroupingAdd( string apikey, string id, string name, string type_name, string[] groups );
		//
		[XmlRpcMethod( "listInterestGroupingDel" )]              // -- v1.2.6
		bool listInterestGroupingDel( string apikey, int grouping_id );
		//
		[XmlRpcMethod( "listInterestGroupingUpdate" )]           // -- v1.2.6
		bool listInterestGroupingUpdate( string apikey, int grouping_id, string name, string value );
		//
		[XmlRpcMethod( "listInterestGroupings" )]                // -- v1.2.6
		x_listInterestGroupings[] listInterestGroupings( string apikey, string id );
		//
		[XmlRpcMethod( "listLocations" )]
		x_listLocations[] listLocations( string apikey, string id );
		//
		[XmlRpcMethod( "listMemberActivity" )]
		XmlRpcStruct listMemberActivity( string apikey, string id, string[] email_address );
		//
		[XmlRpcMethod( "listMemberInfo" )]
		x_listMemberInfo listMemberInfo( string apikey, string id, string[] email_address );
		//
		[XmlRpcMethod( "listMembers" )]
		x_listMembers listMembers( string apikey, string id, string status, string since, int start, int limit );
		//
		[XmlRpcMethod( "listMergeVarAdd" )] // -- new signature in v1.2 (req => options)
		bool listMergeVarAdd( string apikey, string id, string tag, string name, XmlRpcStruct options );
		//
		[XmlRpcMethod( "listMergeVarDel" )]
		bool listMergeVarDel( string apikey, string id, string tag );
		//
		[XmlRpcMethod( "listMergeVarUpdate" )] // --  v1.2.2 added (why not name??)
		bool listMergeVarUpdate( string apikey, string id, string tag, XmlRpcStruct options );
		//
		[XmlRpcMethod( "listMergeVars" )]
		x_listMergeVars[] listMergeVars( string apikey, string id );

		// --------------------------------------------------- static segments, all in MC v1.2.7
		[XmlRpcMethod( "listStaticSegmentAdd" )]
		int listAddStaticSegment( string apikey, string id, string name );
		// 
		[XmlRpcMethod( "listStaticSegmentDel" )]
		bool listDelStaticSegment( string apikey, string id, int seg_id );
		//
		[XmlRpcMethod( "listStaticSegmentReset" )]
		bool listResetStaticSegment( string apikey, string id, int seg_id );
		//
		[XmlRpcMethod( "listStaticSegmentMembersAdd" )]
		x_listStaticSegmentMembersAdd listStaticSegmentAddMembers( string apikey, string id, int seg_id, string[] batch );
		//
		[XmlRpcMethod( "listStaticSegmentMembersDel" )]
		x_listStaticSegmentDelMembers listStaticSegmentDelMembers( string apikey, string id, int seg_id, string[] batch );
		// 
		[XmlRpcMethod( "listStaticSegments" )]
		x_listStaticSegments[] listStaticSegments( string apikey, string id );
		// 
		[XmlRpcMethod( "listSubscribe" )]
		bool listSubscribe( string apikey, string id, string email_address, XmlRpcStruct merge_vars, string email_type, bool double_optin, bool update_existing, bool replace_interests, bool send_welcome );
		//
		[XmlRpcMethod( "listUnsubscribe" )]
		bool listUnsubscribe( string apikey, string id, string email_address, bool delete_member, bool send_goodbye, bool send_notify );
		//
		[XmlRpcMethod( "listUpdateMember" )]
		bool listUpdateMember( string apikey, string id, string email_address, XmlRpcStruct merge_vars, string email_type, bool replace_interests );
		//
		[XmlRpcMethod( "listWebhookAdd" )]
		bool listWebhookAdd( string apikey, string id, string url, XmlRpcStruct actions, XmlRpcStruct sources );
		//
		[XmlRpcMethod( "listWebhookDel" )]
		bool listWebhookDel( string apikey, string id, string url );
		//
		[XmlRpcMethod( "listWebhooks" )]
		x_listWebhook[] listWebhooks( string apikey, string id );
		//      
		[XmlRpcMethod( "lists" )]
		x_lists lists( string apikey, XmlRpcStruct filters, int start, int limit );

		#endregion

		#region ================================================= "Security"

		[XmlRpcMethod( "apikeyAdd" )]
		string apikeyAdd( string username, string password, string apikey );
		[XmlRpcMethod( "apikeyExpire" )]
		bool apikeyExpire( string username, string password, string apikey );
		[XmlRpcMethod( "apikeys" )]
		x_apikeys[] apikeys( string username, string password, string apikey, bool expired );

		#endregion

		#region --------------------------------------------------------------- "Templates"
		//
		[XmlRpcMethod( "templateAdd" )]
		int templateAdd( string apikey, string name, string html );
		//
		[XmlRpcMethod( "templateDel" )]
		bool templateDel( string apikey, int id );
		//
		[XmlRpcMethod( "templateInfo" )]
		x_templateInfo templateInfo( string apikey, int tid, string type );
		//
		[XmlRpcMethod( "templateUndel" )]
		bool templateUndel( string apikey, int id );
		//
		[XmlRpcMethod( "templateUpdate" )]
		bool templateUpdate( string apikey, int id, XmlRpcStruct values );
		//
		[XmlRpcMethod( "templates" )]
		x_templates templates( string apikey, XmlRpcStruct types, string category, XmlRpcStruct inactives );
		//
		#endregion

	}
}
